package org.hxd.user.service;

import org.hxd.pojo.User_inf;
import org.hxd.units.PageModel;
import org.hxd.user.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public User_inf query_User(User_inf user_inf) {
        return userDao.query_User(user_inf);
    }

    @Override//分页查询
    public List<User_inf> findUser(User_inf user_inf, PageModel pageModel) {
        Map map = new HashMap();
        map.put("user",user_inf);
        map.put("pageModel",pageModel);
        return userDao.findUser(map);
    }

    @Override
    public int findUserCount(User_inf user_inf) {
        return userDao.finduserCount(user_inf);
    }

    @Override//根据id查询用户
    public User_inf findUserByid(Integer id) {
        return userDao.findUserByid(id);
    }

    @Override//修改用户信息
    public int modifyUser(User_inf user_inf) {
        return userDao.modifyUser(user_inf);
    }

    @Override//添加用户
    public int addUser(User_inf user_inf) {
        return userDao.addUser(user_inf);
    }

    @Override//用户删除
    public int removeUser(Integer[] ids) {
        return userDao.removeUser(ids);
    }

    @Override
    public User_inf findUserByname(String loginname) {
        return userDao.findUserByname(loginname);
    }


}
